package com.lenovo.leos.filebrowser.engine.model;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import android.content.Context;

import com.lenovo.leos.filebrowser.engine.util.Log;

public class FileComparatorByName extends FileComparator {
	private static final String TAG = "FileComparatorByName";

	public FileComparatorByName(Context context) throws IOException {
		super(context);
	}

	//@Override
	public int compare(IconifiedText object1, IconifiedText object2) {
		String name1 = object1.getFile().getName();
		String name2 = object2.getFile().getName();
		try {
			return compareString(name1, name2);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			Log.e(TAG,
					"UnsupportedEncodingException in FileComparatorByName");
			e.printStackTrace();
		}
		return 1;
	}
}